<template lang="html">
  <div class="game-suggest" id="game-suggest">
    <img id="game-suggest-img" class="game-suggest-bg" src="../../../assets/images/game/gameSuggest.jpg">
    <div class="game-suggest_name-and-index">
        <div class="game-suggest_name" @click="jump2Detail(game)" >{{game.GAME_NAME}}<span class="game-suggest_detail" >查看详情</span></div>
    </div>
    <div class="suggest-error">
    </div>
  </div>
</template>

<script>
import {openGame} from 'components/game/openGame'
export default {
  props: {
    game:Object
  },
  methods: {
    jump2Detail (game) {
      if (!game.GAME_ID) return;
      // let gameId = game.GAME_ID;
      // let gameName = game.GAME_NAME;
      // let gameMaxLimit = game.GAME_MAX_LIMIT;
      // let gameAttendPerson = game.GAME_ATTEND_PERSON;
      // let createUser = game.USER_CODE;
      // let joinBeginDate = game.JOIN_BEGIN_DATE.replace(/\./g, '');
      // let joinEndDate = game.JOIN_END_DATE.replace(/\./g, '');
      // let beginDate = game.BEGIN_DATE.replace(/\./g, '');
      // let endDate = game.END_DATE.replace(/\./g, '');

      // window.location.href = "./game.details.html?gameId="+gameId+'&gameName='+gameName+'&' +
      //     'gameMaxLimit='+gameMaxLimit+'&gameAttendPerson='+gameAttendPerson+'&createUser='+createUser+'&' +
      //     'joinBeginDate='+joinBeginDate+'&joinEndDate='+joinEndDate+'&beginDate='+beginDate+'&endDate'+endDate;

      //跳转到比赛详情页携带参数: gameId
      // this.$router.push({path: '/game/gamedetail',query:{gameId:gameId}});
      openGame(game, this)
    },
  }
}
</script>

<style lang="css" scoped>
  .game_main .game-suggest-bg{
    width: 100%;
    height: 40%;
  }
</style>
